import { Button, Col, Form, FormInstance, Input, Row, Select, Space } from 'antd';

interface SearchformProps {
  onSearch: (value: any) => void;
  form: FormInstance;
}

const Searchform = (props: SearchformProps) => {
  return (
    <Form form={props.form} initialValues={{ platform: '' }}>
      <Row gutter={24}>
        <Col span={8}>
          <Form.Item
              name="platform"
              label="平台"
            >
            <Select>
              <Select.Option value="" >全部</Select.Option>
              <Select.Option value={1} >国家博物馆</Select.Option>
              <Select.Option value={2} >故宫博物馆</Select.Option>
            </Select>
          </Form.Item>
        </Col>
        <Col span={8}>
          <Form.Item
              name="createUser"
              label="下单人"
            >
            <Input placeholder='请输入下单人' />
          </Form.Item>
        </Col>
        <Col span={8}>
          <Space size="small">
            <Button type="primary" onClick={props.onSearch}>
              查询
            </Button>
            <Button
              onClick={() => {
                props.form.resetFields();
              }}
            >
              重置
            </Button>
          </Space>
        </Col>
      </Row>
    </Form>
  );
};

export default Searchform;
